home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1997 May / PC Shareware 1997-05.iso / gry / kungfu / kfk.exe / KFKLVL9.DXR / 00005_Timers script.ls < prev    next >
Encoding:
Text File  |  1997-02-16  |  1.6 KB  |  52 lines

  1. global gNastyTimer1, gNastyTimer2, gNastyTimer3, gNastyTimer4, lastTimeDown, gNastyTimer5, gNastyTimer6, gAsteroidTimer1On, gAsteroidSpeed, gtimerflag, gtimerflagB, gtimerflagC, gtimerflagD
  2.  
  3. on initTimers
  4.   set gNastyTimer1 to the ticks
  5.   set gNastyTimer2 to the ticks
  6.   set gNastyTimer3 to the ticks
  7.   set gNastyTimer4 to the ticks
  8.   set gNastyTimer5 to the ticks
  9.   set gNastyTimer6 to the ticks
  10.   set gAsteroidTimer1On to 0
  11.   set gCreditsTimer to 0
  12.   set gtimerflag to 0
  13.   set gtimerflagB to 0
  14.   set gtimerflagC to 0
  15.   set gtimerflagD to 0
  16.   set gAsteroidSpeed to 1
  17. end
  18.  
  19. on checkTimers
  20.   if the ticks > (gNastyTimer1 + seconds(2.0)) then
  21.     NastyTimer1Up()
  22.     set gNastyTimer1 to the ticks
  23.   end if
  24.   if (the ticks > (gNastyTimer4 + (seconds(4.0) / gAsteroidSpeed))) and (gAsteroidTimer1On = 1) then
  25.     if random(3) > 1 then
  26.       AsteroidTimer1Up()
  27.       set gNastyTimer4 to the ticks
  28.     end if
  29.   end if
  30.   if (the ticks > (gNastyTimer2 + seconds(120.0))) and (gtimerflag = 0) then
  31.     set gAsteroidTimer1On to 1
  32.     set gtimerflag to 1
  33.   end if
  34.   if (the ticks > (gNastyTimer3 + seconds(150.0))) and (gtimerflagB = 0) then
  35.     set gAsteroidSpeed to gAsteroidSpeed * 2
  36.     set gtimerflagB to 1
  37.   end if
  38.   if (the ticks > (gNastyTimer3 + seconds(180.0))) and (gtimerflagC = 0) then
  39.     set gAsteroidSpeed to gAsteroidSpeed * 2
  40.     set gtimerflagC to 1
  41.   end if
  42.   if (the ticks > (gNastyTimer3 + seconds(210.0))) and (gtimerflagD = 0) then
  43.     set gAsteroidSpeed to gAsteroidSpeed * 2
  44.     set gtimerflagD to 1
  45.   end if
  46.   checkCreditTimers()
  47. end
  48.  
  49. on seconds howMany
  50.   return howMany * 60
  51. end
  52.